package com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.entity.Prescription;

import io.lettuce.core.dynamic.annotation.Param;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface PrescriptionMapper extends BaseMapper<Prescription> {
    @Insert("insert into prescription (visit_id,diagnosis_name) values (#{visitId},#{diagnosisName})")
    void insert(@Param("visit_id") int visitId,@Param("diagnosis_name") String diagnosisName);

    @Select("select prescription_id from prescription where visit_id = #{visitId}")
    int selectByVisitId(@Param("visit_id") int visitId);
}
